import { request } from '@pkg/request/src';

export enum Api {
  page = '/exchangeGoods/page',
  list = '/exchangeGoods/list',
  get = '/exchangeGoods/get',
  add = '/exchangeGoods/save',
  update = '/exchangeGoods/update',
  remove = '/exchangeGoods/remove',
  cancelExchangeGoods = '/exchangeGoods/cancelExchangeGoods',
  createUserGoodsByBusExchangeGoods = '/exchangeGoods/createUserGoodsByBusExchangeGoods',
}

export const createUserGoodsByBusExchangeGoods = (exchangeGoodsId: string) =>
  request.post(
    {
      url: Api.createUserGoodsByBusExchangeGoods,
      params: { exchangeGoodsId: exchangeGoodsId },
    },
    { errorMessageMode: 'message' },
  );

export const cancelExchangeGoods = (exchangeGoodsId: string) =>
  request.post(
    {
      url: Api.cancelExchangeGoods,
      params: { exchangeGoodsId: exchangeGoodsId },
    },
    { errorMessageMode: 'message' },
  );
